package com.xwm93up.xxljobdemo.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description: desc
 * @Author: xwm93up
 * @Since: 2022/5/7 15:24
 */
@Slf4j
@Component
public class MyJob {
    @XxlJob("demoJobHandler")
    public ReturnT<String> demoJobHandler() {
        String jobParam = XxlJobHelper.getJobParam();
        XxlJobHelper.log("XXL-JOB, hello world: {}", jobParam);
        log.info("XXL-JOB, hello world: {}", jobParam);
        return ReturnT.SUCCESS;
    }
}
